﻿using Cl.Entity.DataBaseEntity.User;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cl.Entity.BaseEntity
{
    /// <summary>
    /// 实体基类
    /// </summary>
    public class EntityBase : IDeleted
    {
        /// <summary>
        /// 如果是主键，此处必须指定，否则会引发InSingle(id)方法异常。     
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        public int? DeletedId { get; set; }
        public DateTime? DeleteTime { get; set; }

        public int CreateId { get; set; }
        public DateTime CreateTime { get; set; }

        [Navigate(NavigateType.OneToOne, nameof(CreateId))]
        public User CreateUser { get; set; }


    }
}
